package com.qinghuan.threads.chapterTwo;

/**
 * @Author: dubao
 * @Date: 2022/5/22 10:17
 * @Description:
 */

/**
 * 可重入锁
 */
public class Test2_12 {

    public synchronized void hello1() {
        System.out.println("hello");
    }

    public synchronized void helloB()  {
        System.out.println("hello B");
        hello1();
    }


    public static void main(String[] args) {
        Test2_12 test = new Test2_12();
        test.helloB();
        test.hello1();
    }

}
